package com.lxb.blog.service.ImpI;


import com.lxb.blog.dao.UserRepository;
import com.lxb.blog.entity.User;
import com.lxb.blog.service.UserService;
import com.lxb.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserRepository userRepository;
    @Override
    public User checkUser(String username, String password) {

        User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));

        return user;
    }
}
